#include "Log.h"

static logog::Cout *out = NULL;
static logog::LogFile *lfile = NULL;

static std::string g_file;

void initLog(const char* file, bool sout)
{
	LOGOG_INITIALIZE();
	if (true == sout)
	{
		out = new logog::Cout();
	}
	if (file != NULL)
	{
		g_file = file;
		lfile = new logog::LogFile(file);
	}
}

void shutdownLog()
{
	PROFILER_UPDATE();
	if (!g_file.empty())
	{	
		PROFILER_OUTPUT((g_file+".profiler").c_str());
	}
	else
	{
		PROFILER_OUTPUT();
	}
	PROFILER_DESTROY();
	if (out!=NULL)
	{
		delete out;
		out = NULL;
	}
	if (lfile!=NULL)
	{
		delete lfile;
		lfile = NULL;
	}
	LOGOG_SHUTDOWN();
}